package com.mdxl;


import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
/**
 * Created by chengjian on 2017/9/11.
 */

@SpringBootApplication(scanBasePackages = {"com.mdxl"})
//@EnableAutoConfiguration
/*
* 修改springboot的启动类, 在类上加如下注解，关闭security功能。
* 主要是因为activiti的依赖中含有spring security的jar包，
* 所以springboot会自动配置安全功能，访问时就需要输入密码。
* */
@EnableAutoConfiguration(exclude = {
        org.springframework.boot.autoconfigure.security.SecurityAutoConfiguration.class,
        org.activiti.spring.boot.SecurityAutoConfiguration.class,
})
public class HelloApplication {
    /*@Autowired
    private TaskService taskService;
    @Autowired
    private ProcessEngine processEngine;*/
    public static void main(String args[]){
        SpringApplication.run(HelloApplication.class);
    }

    @Bean
    public CommandLineRunner commandLineRunner(ApplicationContext ctx){
        return args ->{
            System.out.println("Let's inspect the beans provided by Spring Boot:");
            System.out.println("我叫程舰，一个传说，仅此而已，别无他求！");
            /*String[] beanNames = ctx.getBeanDefinitionNames();
            Arrays.sort(beanNames);
            for (String beanName : beanNames) {
                System.out.println(beanName);
            }*/
        };

    }
}
